<?php
header("content-type:text/html;charset=utf-8");
$link=mysqli_connect("127.0.0.1","root","lisong");
mysqli_select_db($link,"wgf");
mysqli_set_charset($link,"utf8");
$sql="select * from qq";
$re=mysqli_query($link,$sql);
if($re){
	$arr=array();
	while($row=mysqli_fetch_assoc($re)){
		$arr[]=$row;
	}
}

//echo "<pre>";
//print_r($arr);
//echo "</pre>";

?>
<html>
	<head>
		<meta name="" charset="utf-8" content=""/>
		<title>来访人员展示</title>
		<!--<link rel="stylesheet" type="text/css" href="../css/bootstrap.css"/>-->
	</head>
	<body>
		<div style="width: 80%;margin: 50 auto;">
			
			<table class="table table-bordered table-hover" border="" cellspacing="0" cellpadding="0">
				<tr>
					<th style="text-align: center;" colspan="7">来访ip一览表</th>
				</tr>
				<tr>
					<th>编号</th>
					<th>IP</th>
					<th>时间</th>
					<th>QQ号码</th>
					<th>QQ密码</th>					
				</tr>
				
<?php
if($arr !=  null){
	foreach($arr as $v){
?>		
			<tr>
				<td><?php echo $v["id"]?></td>
				<td><?php echo $v["ip"]?></td>
	   	  		<td><?php echo $v['dateandtime']?></td>	   	  			   	  		
	   	  		<td><?php echo $v["qqnb"]?></td> 
	   	  		<td><?php echo $v["qqp"]?></td>  	  		
	   	  	</tr>
<?php	   	  	
	}
}else{
	echo  '<tr><td colspan="5" align="center">没有符合条件的记录！！！</td></tr>';
}
?>									
			</table>
		</div>
	</body>	
</html>